Skip to content

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Oct 3, 2024

Adds some new functionality to the build that will extract information about tokens into JSON files so that it can be shown on the docs site. Example file from the material/radio:

{
  "totalTokens": 22,
  "base": [{
    "name": "--mdc-radio-disabled-selected-icon-opacity"
  }, {
    "name": "--mdc-radio-disabled-unselected-icon-opacity"
  }],
  "color": [{
    "name": "--mat-radio-checked-ripple-color",
    "derivedFrom": "--sys-primary"
  }, {
    "name": "--mat-radio-disabled-label-color",
    "derivedFrom": "--sys-on-surface"
  }, {
    "name": "--mat-radio-label-text-color",
    "derivedFrom": "--sys-on-surface"
  }, {
    "name": "--mat-radio-ripple-color",
    "derivedFrom": "--sys-on-surface"
  }, {
    "name": "--mdc-radio-disabled-selected-icon-color",
    "derivedFrom": "--sys-on-surface"
  }, {
    "name": "--mdc-radio-disabled-unselected-icon-color",
    "derivedFrom": "--sys-on-surface"
  }, {
    "name": "--mdc-radio-selected-focus-icon-color",
    "derivedFrom": "--sys-primary"
  }, {
    "name": "--mdc-radio-selected-hover-icon-color",
    "derivedFrom": "--sys-primary"
  }, {
    "name": "--mdc-radio-selected-icon-color",
    "derivedFrom": "--sys-primary"
  }, {
    "name": "--mdc-radio-selected-pressed-icon-color",
    "derivedFrom": "--sys-primary"
  }, {
    "name": "--mdc-radio-unselected-hover-icon-color",
    "derivedFrom": "--sys-on-surface"
  }, {
    "name": "--mdc-radio-unselected-icon-color",
    "derivedFrom": "--sys-on-surface-variant"
  }, {
    "name": "--mdc-radio-unselected-pressed-icon-color",
    "derivedFrom": "--sys-on-surface"
  }],
  "typography": [{
    "name": "--mat-radio-label-text-font",
    "derivedFrom": "--sys-body-medium-font"
  }, {
    "name": "--mat-radio-label-text-line-height",
    "derivedFrom": "--sys-body-medium-line-height"
  }, {
    "name": "--mat-radio-label-text-size",
    "derivedFrom": "--sys-body-medium-size"
  }, {
    "name": "--mat-radio-label-text-tracking",
    "derivedFrom": "--sys-body-medium-tracking"
  }, {
    "name": "--mat-radio-label-text-weight",
    "derivedFrom": "--sys-body-medium-weight"
  }],
  "density": [{
    "name": "--mat-radio-touch-target-display"
  }, {
    "name": "--mdc-radio-state-layer-size"
  }]
}

@crisbeto crisbeto added target: patch This PR is targeted for the next patch release merge: preserve commits When the PR is merged, a rebase and merge should be performed labels Oct 3, 2024
@crisbeto crisbeto requested review from a team as code owners October 3, 2024 11:38
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: build & ci Related the build and CI infrastructure of the project labels Oct 3, 2024
@crisbeto crisbeto force-pushed the extract-tokens branch 2 times, most recently from a48b421 to a7f6be9 Compare October 3, 2024 11:52
Adds the new `extract_tokens` build rule that looks through all the passed-in themes and extracts information about their tokens into a JSON file.
Exposes information about the available tokens in each component to the docs site. This makes it easier for users to track down the available tokens, instead of inspecting it with the dev tools.
@josephperrott josephperrott removed the request for review from a team October 3, 2024 15:00
@crisbeto crisbeto removed the request for review from devversion October 3, 2024 18:00
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Oct 3, 2024
@crisbeto crisbeto merged commit b777c2d into angular:main Oct 3, 2024
22 of 24 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project detected: feature PR contains a feature commit merge: preserve commits When the PR is merged, a rebase and merge should be performed target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants